﻿using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;

namespace Surging.Core.Common
{
    /// <summary>
    /// 分页信息类
    /// 作者：李龙
    /// 时间: 2019-01-30
    /// </summary>
    [DataContract]
    public class PageInfo
    {
        private int _pageIndex = 1;
        private int _pageSize = 20;
        public PageInfo(int pageIndex = 1, int pageSize = 20)
        {
            _pageIndex = pageIndex;
            _pageSize = pageSize;
        }
        [DataMember]
        public int PageIndex
        {
            get
            {
                if (_pageIndex < 1)
                {
                    _pageIndex = 1;
                }
                return _pageIndex;
            }
            set
            {
                _pageIndex = value;
            }
        }

        [DataMember]
        public int PageSize
        {
            get
            {
                if (_pageSize < 1)
                {
                    _pageSize = 20;
                }
                return _pageSize;
            }
            set
            {
                _pageSize = value;
            }
        }

        [DataMember]
        public int TotalCount { get; set; }

    }
}
